<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="/jsp/css/changePwd.css"/>
</head>
<body>
<div align="center" class="info">${repeat}</div>
<h2 class="user"align="center">${userSession.userName}</h2>
<img class="image" src="/jsp/static/img.png" alt="head">
<div class="changePwd">
    <input type="button" onclick=location.href="jsp/login.jsp" value="返回上一级"/>
    <form name="form1" class="login_box"id="form1" method="post" action="${pageContext.request.contextPath }/User/changePwd/${userSession.userName}">
        <input type="password" name="pwd1" id="pwd1" placeholder="请输入新密码"><br/>
        <input type="password" name="pwd2" id="pwd2" placeholder="请再次输入密码"><br/>
        <input type="button" onclick="f()" value="注册"/>

        <script>
            function f(){
                var form = document.getElementById("form1");
                var mima1 = document.form1.pwd1.value;
                var mima2 = document.form1.pwd2.value;
                if (mima1!=mima2){
                    alert("两次输入的密码不一致!");
                }else{
                    form.submit();
                }
            }
        </script>
    </form>
</div>

</body>
</html>
